package ishitong.core.common;

import java.text.ParseException;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;

/** @pdOid 1b8a4ef0-ce90-47a1-bf8c-3fcd57d6affc */
public class SQLSelectWhere {
   /** @pdOid d0604ed8-7f6c-4753-a3d9-04c107d9ac2d */
   private String strDateBegin;
   /** @pdOid d8237c1b-61a9-4e46-96b2-612272591063 */
   private String strDateEnd;
   /** @pdOid 0f3d9156-c8b9-41a2-8d59-58b4f7a58475 */
   private Date dateBegin;
   /** @pdOid 04995db5-9626-470b-84fa-2b6bf28a9ec9 */
   private Date dateEnd;
   /** @pdOid 755a493c-198a-4f9d-b905-c4901f752c67 */
   private String strDateBegin1;
   /** @pdOid 11535fc7-5459-410e-b7b0-c3fccbd849c1 */
   private String strDateEnd1;
   /** @pdOid fdfbeebc-7162-4c09-a6e2-8ee8f7957780 */
   private Date dateBegin1;
   /** @pdOid 23f3d1e6-3c87-4e38-abe6-643e2cbdfda0 */
   private Date dateEnd1;
   /** @pdOid ec399c65-128a-4eeb-a3b5-cd70ef69667c */
   private String strDateBegin2;
   /** @pdOid c9b783a3-afcc-4374-b1b6-b2d38709424c */
   private String strDateEnd2;
   /** @pdOid 1f2e4a04-1e26-42b5-b544-4fd2d31e97d1 */
   private Date dateBegin2;
   /** @pdOid 6817dd93-544c-4c9a-8e0b-688b3f16ac38 */
   private Date dateEnd2;
   /** @pdOid a0ea5edc-7dd0-48e8-9c45-7f66c99147af */
   private String orderBy;
   /** @pdOid 4df78012-e20d-46ae-9c43-d27a0cb450c4 */
   private String orderType = "desc";
   /** @pdOid d7fa31d8-1b6c-4c0b-a7b0-c2b2b71d2809 */
   private Integer pageIndex = 0;
   /** @pdOid eece31eb-6674-4fdd-85fd-85dafab08837 */
   private Integer pageRows = 10;
   /** @pdOid 79205a99-fad5-4449-908b-314699aebfb8 */
   private Integer recordCount = 0;
   /** @pdOid bbb38900-ba34-45b6-abd4-5e16042455d8 */
   private Integer recordPage;
   /** @pdOid 52650ca9-009c-4440-94a2-78b1834f735b */
   private Integer startRow;
   /** @pdOid 56737850-460e-43c8-9833-a35b43cbd7be */
   private String strParam1 = "";
   /** @pdOid acbfad2c-8072-45fb-8c23-f6ab3645488b */
   private String strParam2 = "";
   /** @pdOid a99e4d30-ffcf-4e8f-bf44-ac8b9d491b8f */
   private String strParam3 = "";
   /** @pdOid 78933780-8a8a-4409-afff-b609e5fe57e6 */
   private String strParam4 = "";
   /** @pdOid c0ab4234-4fde-4d0c-b3a6-291aa5ad5d14 */
   private String strParam5 = "";
   /** @pdOid 1d4b7e8b-fd47-4cb3-9a37-08bfe4b644a1 */
   private String strParam6 = "";
   /** @pdOid 12650c39-e938-4f07-8595-e48e2cae711e */
   private String strParam7 = "";
   /** @pdOid 73163814-d7ce-40ee-90d6-b1afd24826e4 */
   private String strParam8 = "";
   
   /** @pdOid 9a6f8253-9b80-43e5-91ef-9e27d476e79b */
   public static final String SYS_DATEFORMAT = "yyyy-MM-dd";
   /** @pdOid e6e4cdd2-7884-496d-aaab-688796f5714f */
   public static final String SYS_TIMEFORMAT = "hh:mm:ss";
   /** @pdOid 75d03b0b-c990-43b8-b28b-6d838111da94 */
   public static final String SYS_DATETIMEFORMAT = SYS_DATEFORMAT + " " + SYS_TIMEFORMAT;
   
   /** @param strDate 
    * @param pattern
    * @exception ParseException
    * @pdOid 281c5503-0f31-4552-a05f-5b56ba2533d7 */
   public static Date StringToDate(String strDate, String pattern) throws ParseException {
   	Date date = null;
   	if (!StringUtils.isBlank(strDate)) {
   		if (StringUtils.isBlank(pattern)){
   			pattern = SYS_DATEFORMAT;
   		}
   		date = DateUtils.parseDate(strDate,new String[]{pattern});
   	}
   	return date;
   }
   
   /** @pdOid eb54c656-450b-4b4b-bfc2-315b5576c334 */
   public String getOrderBy() {
   	return orderBy;
   }
   
   /** @param orderBy
    * @pdOid 91c90041-1952-47fe-b11a-31cc1628a5ca */
   public void setOrderBy(String orderBy) {
   	this.orderBy = orderBy;
   }
   
   /** @pdOid c327fe95-abf8-4c7a-bfea-cee6b9f8da0b */
   public String getOrderType() {
   	return orderType;
   }
   
   /** @param orderType
    * @pdOid 14727f6b-5dde-418d-a7b8-984b0d829bb1 */
   public void setOrderType(String orderType) {
   	this.orderType = orderType;
   }
   
   /** @pdOid cc57b573-17b5-40ee-9b04-db815b50f9c2 */
   public Integer getPageIndex() {
   	return pageIndex;
   }
   
   /** @param pageIndex
    * @pdOid 60e24272-fd87-49f9-8d83-0625074d0e4a */
   public void setPageIndex(Integer pageIndex) {
   	this.pageIndex = pageIndex;
   }
   
   /** @pdOid 89f14ab6-d9d7-48b7-8464-371f91b96314 */
   public Integer getPageRows() {
   	return pageRows;
   }
   
   /** @param pageRows
    * @pdOid 8635487e-8742-4d32-aa8e-1193735fa573 */
   public void setPageRows(Integer pageRows) {
   	this.pageRows = pageRows;
   }
   
   /** @pdOid 642d63e5-6a03-4401-a34a-a1382c197b46 */
   public Integer getStartRow() {
   	startRow = pageIndex * pageRows;
   	return startRow;
   }
   
   /** @pdOid b92b55c8-c542-4106-ba86-ce534609d090 */
   public String getStrDateBegin() {
   	return strDateBegin;
   }
   
   /** @param strDateBegin
    * @exception ParseException
    * @pdOid 1d5c0d4a-36ab-45a2-840e-be2312374353 */
   public void setStrDateBegin(String strDateBegin) throws ParseException {
   	this.strDateBegin = strDateBegin;
   	if (strDateBegin != null && !("").equals(strDateBegin)) {
   		this.dateBegin = StringToDate(strDateBegin,null);
   	} else {
   		this.dateBegin = StringToDate("1900-01-01",null);
   	}
   }
   
   /** @pdOid 4c39fb91-936e-4a84-a19d-cde9f6fb91e0 */
   public String getStrDateEnd() {
   	return strDateEnd;
   }
   
   /** @param strDateEnd
    * @exception ParseException
    * @pdOid b4d33163-6de3-4871-b8d2-6c38687e9c42 */
   public void setStrDateEnd(String strDateEnd) throws ParseException {
   	this.strDateEnd = strDateEnd;
   	if (strDateEnd != null && !("").equals(strDateEnd)) {
   		this.dateEnd = StringToDate(strDateEnd + " 23:59:59",SYS_DATETIMEFORMAT);
   	} else {
   		//this.dateEnd = new Date();
   	}
   }
   
   /** @pdOid e71501f7-cb84-4923-9e0d-ecaf574dbeeb */
   public Date getDateBegin() {
   	return dateBegin;
   }
   
   /** @param dateBegin
    * @pdOid a7f9678a-0bca-4ef1-9c61-fa1f5c703676 */
   public void setDateBegin(Date dateBegin) {
   	this.dateBegin = dateBegin;
   }
   
   /** @pdOid 411cd061-f2c1-42d7-9dd1-339cba2f9ed7 */
   public Date getDateEnd() {
   	return dateEnd;
   }
   
   /** @param dateEnd
    * @pdOid 5cc2b6ec-9a5f-464f-b1cb-1023b3785a72 */
   public void setDateEnd(Date dateEnd) {
   	this.dateEnd = dateEnd;
   }
   
   /** @pdOid 2e9a0eac-0f50-426e-929c-eb1985803cc4 */
   public String getStrDateBegin1() {
   	return strDateBegin1;
   }
   
   /** @param strDateBegin1
    * @exception ParseException
    * @pdOid eeab73ab-f8ab-4a57-97ef-ef9c69ff8144 */
   public void setStrDateBegin1(String strDateBegin1) throws ParseException {
   	this.strDateBegin1 = strDateBegin1;
   	if (strDateBegin1 != null && !("").equals(strDateBegin1)) {
   		this.dateBegin1 = StringToDate(strDateBegin1,null);
   	} else {
   		this.dateBegin1 = StringToDate("1900-01-01",null);
   	}
   }
   
   /** @pdOid a0136fe6-ffaa-4720-9c3c-fa5c75a507f8 */
   public String getStrDateEnd1() {
   	return strDateEnd1;
   }
   
   /** @param strDateEnd1
    * @exception ParseException
    * @pdOid 6f8fa987-669f-47cd-9ee8-672390361267 */
   public void setStrDateEnd1(String strDateEnd1) throws ParseException {
   	this.strDateEnd1 = strDateEnd1;
   	if (strDateEnd1 != null && !("").equals(strDateEnd1)) {
   		this.dateEnd1 = StringToDate(strDateEnd1 + " 23:59:59",SYS_DATETIMEFORMAT);
   	} else {
   		//this.dateEnd1 = new Date();
   	}
   }
   
   /** @pdOid 5d4fc3b1-e80d-4a05-8f15-c6d9af697fcd */
   public Date getDateBegin1() {
   	return dateBegin1;
   }
   
   /** @param dateBegin1
    * @pdOid 3093bc29-3357-42a3-8c7e-706cfa8c046d */
   public void setDateBegin1(Date dateBegin1) {
   	this.dateBegin1 = dateBegin1;
   }
   
   /** @pdOid d147bd49-7950-4d9d-b23f-00349f1b0b43 */
   public Date getDateEnd1() {
   	return dateEnd1;
   }
   
   /** @param dateEnd1
    * @pdOid 16a7eacf-e8fb-43e1-b7a2-378574d27a47 */
   public void setDateEnd1(Date dateEnd1) {
   	this.dateEnd1 = dateEnd1;
   }
   
   /** @pdOid 858609e1-d0ac-4808-b519-de66d47e3fbc */
   public String getStrDateBegin2() {
   	return strDateBegin2;
   }
   
   /** @param strDateBegin2
    * @exception ParseException
    * @pdOid 6c34f5d8-9df1-46ff-8f89-996cf35ece3a */
   public void setStrDateBegin2(String strDateBegin2) throws ParseException {
   	this.strDateBegin2 = strDateBegin2;
   	if (strDateBegin2 != null && !("").equals(strDateBegin2)) {
   		this.dateBegin2 = StringToDate(strDateBegin2,null);
   	} else {
   		this.dateBegin2 = StringToDate("1900-01-01",null);
   	}
   }
   
   /** @pdOid 2fd68e4e-4103-4103-9261-185657650d02 */
   public String getStrDateEnd2() {
   	return strDateEnd2;
   }
   
   /** @param strDateEnd2
    * @exception ParseException
    * @pdOid 90c3ad21-bcd8-43e6-aecd-a0e388902271 */
   public void setStrDateEnd2(String strDateEnd2) throws ParseException {
   	this.strDateEnd2 = strDateEnd2;
   	if (strDateEnd2 != null && !("").equals(strDateEnd2)) {
   		this.dateEnd2 = StringToDate(strDateEnd2 + " 23:59:59",SYS_DATETIMEFORMAT);
   	} else {
   		//this.dateEnd2 = new Date();
   	}
   }
   
   /** @pdOid 78acdae5-1354-43a6-867f-b851c9a63202 */
   public Date getDateBegin2() {
   	return dateBegin2;
   }
   
   /** @param dateBegin2
    * @pdOid 6d6664e3-6ce1-42d0-9761-d32108710580 */
   public void setDateBegin2(Date dateBegin2) {
   	this.dateBegin2 = dateBegin2;
   }
   
   /** @pdOid b08bd919-c899-44c5-91ea-6dd3fe4b22c0 */
   public Date getDateEnd2() {
   	return dateEnd2;
   }
   
   /** @param dateEnd2
    * @pdOid 5022f527-798d-496d-be24-765f30005212 */
   public void setDateEnd2(Date dateEnd2) {
   	this.dateEnd2 = dateEnd2;
   }
   
   /** @pdOid 56d4cdff-1fd0-4f34-b255-f0e6cafc88aa */
   public String getStrParam1() {
   	return strParam1;
   }
   
   /** @param strParam1
    * @pdOid af45c77a-9507-45c0-8c73-597f27d81504 */
   public void setStrParam1(String strParam1) {
   	this.strParam1 = strParam1;
   }
   
   /** @pdOid dc13ca8e-03d4-4f28-8f94-d4c51e055499 */
   public String getStrParam2() {
   	return strParam2;
   }
   
   /** @param strParam2
    * @pdOid 462a4c62-b127-4f7c-8e6e-cb13951147a7 */
   public void setStrParam2(String strParam2) {
   	this.strParam2 = strParam2;
   }
   
   /** @pdOid 6610c0a6-b260-4b61-ac5b-0615d74ffca3 */
   public String getStrParam3() {
   	return strParam3;
   }
   
   /** @param strParam3
    * @pdOid 80972300-09d2-4d43-8603-e1ef04451a8a */
   public void setStrParam3(String strParam3) {
   	this.strParam3 = strParam3;
   }
   
   /** @pdOid d7f00df8-aed1-4b22-806f-1b1797ad4d34 */
   public String getStrParam4() {
   	return strParam4;
   }
   
   /** @param strParam4
    * @pdOid c3e0c970-46e1-4506-820a-8387da3b9768 */
   public void setStrParam4(String strParam4) {
   	this.strParam4 = strParam4;
   }
   
   /** @pdOid c789d306-763e-467e-b3ba-ad216f3038d7 */
   public String getStrParam5() {
   	return strParam5;
   }
   
   /** @param strParam5
    * @pdOid 8f9e460f-6f9e-4577-b635-514ee77c6f00 */
   public void setStrParam5(String strParam5) {
   	this.strParam5 = strParam5;
   }
   
   /** @pdOid 57c27ab3-6c0d-4924-ba51-96cd8d38f4c8 */
   public String getStrParam6() {
   	return strParam6;
   }
   
   /** @param strParam6
    * @pdOid 95c08ba6-2ac7-4e05-a620-e7e3edf3456b */
   public void setStrParam6(String strParam6) {
   	this.strParam6 = strParam6;
   }
   
   /** @pdOid bc778158-7e9f-43b8-8554-530b2a4d9285 */
   public String getStrParam7() {
   	return strParam7;
   }
   
   /** @param strParam7
    * @pdOid f9891822-7c28-4ed8-9d54-59ffc36fa655 */
   public void setStrParam7(String strParam7) {
   	this.strParam7 = strParam7;
   }
   
   /** @pdOid b8f118f2-4880-495d-bc57-76db0b3b9639 */
   public String getStrParam8() {
   	return strParam8;
   }
   
   /** @param strParam8
    * @pdOid 4a9011b7-d590-4355-bfba-4665cabd2fb6 */
   public void setStrParam8(String strParam8) {
   	this.strParam8 = strParam8;
   }
   
   /** @pdOid 237b22aa-9c32-4383-a59f-794a336e5e82 */
   public Integer getRecordCount() {
   	return recordCount;
   }
   
   /** @param recordCount
    * @pdOid 26e82dca-5c19-4e83-afbd-439843eccb1f */
   public void setRecordCount(Integer recordCount) {
   	this.recordCount = recordCount;
   }
   
   /** @param startRow
    * @pdOid 4b2c69c0-6843-4ee3-a3ea-f26c91029cf1 */
   public void setStartRow(Integer startRow) {
   	this.startRow = startRow;
   }
   
   /** @pdOid 656650bf-bb10-4fc0-a2fc-4d597bb3662f */
   public Integer getRecordPage() {
   	recordPage = (int) Math.ceil(recordCount * 1.0 / pageRows);
   	return recordPage;
   }
   
   /** @param recordPage
    * @pdOid 232797a6-9f1c-47c4-841b-2b79b3a21fff */
   public void setRecordPage(Integer recordPage) {
   	this.recordPage = recordPage;
   }

}